
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Collections.Generic;
using System.Text;

using Swaf.BizObj;
using Swaf.BizRule;

namespace Swaf.Resource
{
	public class BasicLocalizationBizRules
	{
		/// <summary>
		/// Returns a list of every country defined in the countries table.
		/// </summary>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <returns></returns>
		public IBizObjList getAllKnownCountries(IApplication app, IRuleContext context)
		{
			IBizObjList countries = null;
			return countries;
		}

		/// <summary>
		/// Returns a list of countries in the CompanyCountries table for a given company.  These
		/// are the countries that the company wants exposed to the user for what country then can choose
		/// for addresses.
		/// </summary>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <returns></returns>
		public IBizObjList getCompanyPreferredCountries(IApplication app, IRuleContext context)
		{
			IBizObjList countries = null;
			return countries;
		}

		/// <summary>
		/// This rule will first delete all of the active company's preffered countries and then add all the countries
		/// in the given list.  This is ok, because there are not enough countries in the world to worry about
		/// performance.  
		/// </summary>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <param name="companyId"></param>
		/// <param name="countries"></param>
		public void setCompanyPreferredCountries(IApplication app, IRuleContext context, IBizObjList countries)
		{
		}

		/// <summary>
		/// Gets a list of countries for a given company that have cultures that refer to them.
		/// </summary>
		/// <remarks>
		/// Check for "MapUndefinedCountriesToCulture" macro that will have a culture browser code
		/// that is the default culture to use for preferredCountries that dont have a real culture.
		/// If that macro is not defined, the list returned will not contain countries that dont have
		/// a real culture mapped to it in the database.  This allows for a large list of preferredCountries
		/// that can be picked for a culture selection that dont have a fully defined culture defined specifically for
		/// it.  This will be good for sites that want the user to pick what country they are from and the site
		/// will map to a standard culture for that country.
		/// </remarks>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <returns></returns>
		public IBizObjList getCountriesWithActiveCultures(IApplication app, IRuleContext context)
		{
			IBizObjList countries = null;
			return countries;
		}

		/// <summary>
		/// Gets a list of all of the known cultures in the system, regardless of having actual translations
		/// available for them or the company.  There is only one list of known cultures
		/// </summary>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <returns></returns>
		public IBizObjList getAllKnownCultures(IApplication app, IRuleContext context)
		{
			IBizObjList countries = null;
			return countries;
		}

		/// <summary>
		/// Gets a list of cultures that have a language with at least one translation for it.
		/// For the active company and are marked as "isActive == true".
		/// </summary>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <returns></returns>
		public IBizObjList getActiveCultures(IApplication app, IRuleContext context)
		{
			IBizObjList countries = null;
			return countries;
		}

		/// <summary>
		/// Returns an ActiveCulture type bizobj, with translated text in it.
		/// </summary>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <param name="cultureBrowserCode"></param>
		/// <returns></returns>
		public IBizObj getCultureDetailsWithTranslationText(IApplication app, IRuleContext context, string cultureBrowserCode)
		{
			IBizObj activeCulture = null;
			return activeCulture;
		}
		
		/// <summary>
		/// Creates or updates the given culture (based on culture.isNew field)
		/// </summary>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <param name="culture"></param>
		public void createUpdateCulture(IApplication app, IRuleContext context, IBizObj culture)
		{
		}

		public void deleteCulture(IApplication app, IRuleContext context, string cultureBrowserCode)
		{
		}

		public IBizObjList getAllTranslations(IApplication app, IRuleContext context)
		{
			IBizObjList translations = null;
			return translations;
		}

		public IBizObjList getTranslationsForLanguage(IApplication app, IRuleContext context, string language6392Code)
		{
			IBizObjList translations = null;
			return translations;
		}

		public IBizObjList getTranslationTexts(IApplication app, IRuleContext context, Swaf.BGuid.Guid translationId)
		{
			IBizObjList texts = null;

			return texts;
		}

		/// <summary>
		/// The translationInfo bizobj can contain the texts that make up the translation and those will be inserted/updated
		/// as well.
		/// This will not blinkdly delete all existing translation texts and re-add them from the translationInfo.  Each
		/// text will be checked for isNew and updated/inserted as needed.  Note that a blank value for the text will cause
		/// the text to be deleted from the database.
		/// </summary>
		/// <param name="app"></param>
		/// <param name="context"></param>
		/// <param name="translationInfo"></param>
		public void createUpdateTranslation(IApplication app, IRuleContext context, IBizObj translationInfo)
		{
		}

		public void deleteTranslation(IApplication app, IRuleContext context, Swaf.BGuid.Guid translationId)
		{
		}

		public IBizObjList getAllKnownLanguages(IApplication app, IRuleContext context)
		{
			IBizObjList languages = null;
			return languages;
		}

		public IBizObjList getLanguagesWithTranslations(IApplication app, IRuleContext context)
		{
			IBizObjList languages = null;
			return languages;
		}


	}
}
